package com.ruoyi.chatmessage.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.chatmessage.mapper.ChatmessageMapper;
import com.ruoyi.chatmessage.domain.Chatmessage;
import com.ruoyi.chatmessage.service.IChatmessageService;

/**
 * chatmessageService业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-14
 */
@Service
public class ChatmessageServiceImpl implements IChatmessageService 
{
    @Autowired
    private ChatmessageMapper chatmessageMapper;

    /**
     * 查询chatmessage
     * 
     * @param chatMessageId chatmessage主键
     * @return chatmessage
     */
    @Override
    public Chatmessage selectChatmessageByChatMessageId(Long chatMessageId)
    {
        return chatmessageMapper.selectChatmessageByChatMessageId(chatMessageId);
    }

    /**
     * 查询chatmessage列表
     * 
     * @param chatmessage chatmessage
     * @return chatmessage
     */
    @Override
    public List<Chatmessage> selectChatmessageList(Chatmessage chatmessage)
    {
        return chatmessageMapper.selectChatmessageList(chatmessage);
    }

    /**
     * 新增chatmessage
     * 
     * @param chatmessage chatmessage
     * @return 结果
     */
    @Override
    public int insertChatmessage(Chatmessage chatmessage)
    {
        chatmessage.setCreateTime(DateUtils.getNowDate());
        return chatmessageMapper.insertChatmessage(chatmessage);
    }

    /**
     * 修改chatmessage
     * 
     * @param chatmessage chatmessage
     * @return 结果
     */
    @Override
    public int updateChatmessage(Chatmessage chatmessage)
    {
        return chatmessageMapper.updateChatmessage(chatmessage);
    }

    /**
     * 批量删除chatmessage
     * 
     * @param chatMessageIds 需要删除的chatmessage主键
     * @return 结果
     */
    @Override
    public int deleteChatmessageByChatMessageIds(Long[] chatMessageIds)
    {
        return chatmessageMapper.deleteChatmessageByChatMessageIds(chatMessageIds);
    }

    /**
     * 删除chatmessage信息
     * 
     * @param chatMessageId chatmessage主键
     * @return 结果
     */
    @Override
    public int deleteChatmessageByChatMessageId(Long chatMessageId)
    {
        return chatmessageMapper.deleteChatmessageByChatMessageId(chatMessageId);
    }
}
